#define _CRT_SECURE_NO_WARNINGS 1


#include<math.h>
#include<iostream>

using namespace std;

int main()
{
	int a = pow(-2, 3) + pow(-2, 2) + pow(-2, 0);
	cout << a << endl;

	int arr[100] = { 0 }, index = 0, n = 16;
	while (n)
	{
		arr[index++] = n % -2;
		n %= -2;
	}
	for (auto& e : arr)
	{
		cout << e << ' ';
	}
	cout << endl;

	return 0;
}